<?php

class LeftMenu extends CWidget {

    public function run() {
        $sql = 'SELECT name, type, id, nickname FROM `categories` WHERE `type` = \'' . Yii::app()->controller->id . '\'';
        $models = Yii::app()->db->getCommandBuilder()->createSqlCommand($sql)->queryAll();
        if (!empty($models))
            $this->render('leftMenu', array('models' => $models));
    }

}
